<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateArticleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article', function (Blueprint $table) {
            $table->engine = 'Innodb';
            $table->increments('id')->unsigned();
            $table->unsignedInteger('category_id')->default(0)->comment('分类id')->index('category_id');
            $table->unsignedMediumInteger('click')->default(0)->comment('点击');
            $table->unsignedInteger('label_id')->default(0)->comment('标签id');
            $table->string('title', 64)->default('')->comment('分类标题');
            $table->text('content')->comment('内容');
            $table->unsignedTinyInteger('is_recommend')->default(0)->comment('是否推荐:1-是,0-否');
            $table->unsignedInteger('created_at')->default(0);
            $table->unsignedInteger('updated_at')->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article');
    }
}
